<template>
  <div>
    <div>
      <span>您的余额是: [{{ money }}]元</span>
    </div>
    <el-button type="primary" @click="onMoney">查询余额</el-button>
  </div>
</template>

<script>
import { findMoney } from "../../api/user";
export default {
  name: "deposit",
  data() {
    return {
      money: null,
    };
  },
  methods: {
    onMoney() {
      this.getMoney();
    },
    async getMoney() {
      let result = await findMoney(localStorage.getItem("cardNo"));
      console.log(result);
      this.money = result.data.balance;
    },
  },
};
</script>

<style lang="scss" scoped>
</style>